# 1.导包
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
# 2.获取浏览器驱动
driver = webdriver.Firefox()
# 3.打开tmooc的登录页
url = 'https://uc.tmooc.cn/login/jumpTologin'
driver.get(url)
# 4.定位用户名输入admin
driver.find_element(By.ID, 'js_account_pm').send_keys('admin')
# 5.定位密码框输入123456
driver.find_element(By.ID, 'js_password').send_keys('123456')
# 6.停顿3秒，点击登录按钮
sleep(3)
driver.find_element(By.TAG_NAME, 'button').click()
# 7.停顿3秒，关闭浏览器
sleep(3)
driver.quit()